<?php
class Page extends AppModel {
// Define the model and it's associations:
var $name = 'Page';
var $hasAndBelongsToMany = array(
							'Metro' => array(
								'className' => 'Metro',
								'joinTable' => 'objects_pages',
								'foreignKey' => 'page_ID',
								'associationForeignKey' => 'object_ID',
								'unique' => true
								),
							'Town' => array(
								'className' => 'Town',
								'joinTable' => 'objects_pages',
								'foreignKey' => 'page_ID',
								'associationForeignKey' => 'object_ID',
								'unique' => true
								)
							); 


	/*
	/	fetchPageInfoByName: fetch Page info by it's host name
	/	string $page: page name
	*/
	public function fetchPageInfoByName($page) {
		$pageinfo = $this->find('first', array(
			'conditions' => array(
				'Page.name' => $page)/*,
			'fields' => array(
				'Metro.ID')*/));
		return $pageinfo;
	}
}
?>
